//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package 力扣.题库.未分类;

public class demo_242 {
    public demo_242() {
    }

    public static void main(String[] args) {
        System.out.println(isAnagram("car", "rat"));
    }

    public static boolean isAnagram(String s, String t) {
        int[] ascii = new int[26];

        for(int i = 0; i < s.length(); ++i) {
            ++ascii[s.charAt(i) - 97];
        }

        for(int i = 0; i < t.length(); ++i) {
            --ascii[t.charAt(i) - 97];
        }

        for(int i = 0; i < 26; ++i) {
            if (ascii[i] != 0) {
                return false;
            }
        }

        return true;
    }
}
